package com.hh.base.widget.recyclerView

import androidx.databinding.ViewDataBinding
import androidx.recyclerview.widget.RecyclerView
import com.hh.base.BR

/**
 * Create By hHui on 2025/4/3 9:25
 *
 * @description
 */
class BindingViewHolder<T, BINDING : ViewDataBinding>(val binding: BINDING) : RecyclerView.ViewHolder(binding.root) {

    fun bind(t: T?) {
        binding.setVariable(BR.item, t)
    }

    fun setItemEventHandler(handler: Any?) {
        binding.setVariable(BR.handler, handler)
    }

    fun setItemPosition(position:Int){
        binding.setVariable(BR.position, position)
    }
}